/**
 * Copyright (C), 2019-2022, 宇信融汇
 * FileName: Apple
 * Author:   666
 * Date:     2022/1/18 11:00
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 666           修改时间           版本号              描述
 */
package com.setdemo;

import java.util.Objects;

/**
 * @Classname Apple
 * @Description TODO
 * @Date 2022/1/18 11:00
 * @Created by 666
 */
public class Apple {

    private String name;
    private int heigth;
    private double price;

    public Apple() {
    }

    public Apple(String name, int heigth, double price) {
        this.name = name;
        this.heigth = heigth;
        this.price = price;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getHeigth() {
        return heigth;
    }

    public void setHeigth(int heigth) {
        this.heigth = heigth;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Apple apple = (Apple) o;
        return heigth == apple.heigth &&
                Double.compare(apple.price, price) == 0 &&
                Objects.equals(name, apple.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, heigth, price);
    }

    @Override
    public String toString() {
        return "Apple{" +
                "name='" + name + '\'' +
                ", heigth=" + heigth +
                ", price=" + price +
                '}';
    }
}
